#include <iostream>
#include <queue>

using namespace std;
int n;
const int N = 5e3 + 10;
string a;

int bfs(int i)
{
    queue<int>q;
    int ret = 1;
    q.push(i);
    while (q.size())
    {
        int t = q.front(); q.pop();
        if (a[t - 1] == '1' || a[t + 1] == '1') return ret;
        else if (t - 1 < n && t - 1 > 0) q.push(t - 1);
        else if (t + 1 < n && t + 1 > 0) q.push(t + 1);
        ret++;
    }
    return ret;
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a;
    for (int i = 1; i <= n; i++)
    {
        if (a[i] == '0')
        {
            cout << bfs(i) << " ";
        }
    }
    return 0;
}